home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_11_Generic Multi-State Button.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  1.0 KB  |  42 lines

  1. property pHandler, pNumStates, ancestor
  2.  
  3. on beginSprite me
  4.   set ancestor to new(script "Bitmap But 1", the spriteNum of me, pNumStates)
  5. end
  6.  
  7. on MouseUpAction me
  8.   do(pHandler)
  9. end
  10.  
  11. on MouseDownAction me
  12.   nothing()
  13. end
  14.  
  15. on MouseEnterAction me
  16.   nothing()
  17. end
  18.  
  19. on MouseLeaveAction me
  20.   nothing()
  21. end
  22.  
  23. on getPropertyDescriptionList me
  24.   set description to [:]
  25.   addProp(description, #pHandler, [#default: "nothing", #format: #string, #comment: "Hander to Execute on mouseDown"])
  26.   addProp(description, #pNumStates, [#default: 3, #format: #integer, #comment: "Number of States", #range: [2, 3]])
  27.   return description
  28. end
  29.  
  30. on getBehaviorDescription me
  31.   set endChar to offset("--END OF HEADER", the text of me)
  32.   set endLine to the number of lines in char 1 to endChar of the text of me - 1
  33.   set description to line 1 to endLine of the text of me
  34.   repeat with whichLine = endLine down to 1
  35.     if line whichLine of description = EMPTY then
  36.       delete line whichLine of description
  37.     end if
  38.   end repeat
  39.   delete line 1 of description
  40.   return description
  41. end
  42.